package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the REPAIR database table.
 * 
 */
@Entity
@NamedQuery(name="Repair.findAll", query="SELECT r FROM Repair r")
public class Repair implements Serializable {
	private static final long serialVersionUID = 1L;
                  
	@Id
	@SequenceGenerator(name="REPAIR_REPAIRID_GENERATOR", sequenceName="SEQ_40")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="REPAIR_REPAIRID_GENERATOR")
	@Column(name="REPAIR_ID")
	private long repairId;

	@Column(name="CONT_ID")
	private BigDecimal contId;

	@Column(name="CONT_LINK_MAN")
	private String contLinkMan;

	@Column(name="CUSTOMER_ID")
	private BigDecimal customerId;

	@Column(name="CUSTOMER_NAME")
	private String customerName;

	@Column(name="REPAIR_CONNECTO_NAME")
	private String repairConnectoName;

	@Temporal(TemporalType.DATE)
	@Column(name="REPAIR_DATETIME")
	private Date repairDatetime;

	@Column(name="REPAIR_MOVE_ID")
	private String repairMoveId;

	@Column(name="REPAIR_PERSON")
	private BigDecimal repairPerson;

	@Column(name="REPAIR_TEL")
	private String repairTel;

	@Column(name="REPAIR_TYPE")
	private String repairType;

	//bi-directional many-to-one association to DetailRepair
	@OneToMany(mappedBy="repair")
	private List<DetailRepair> detailRepairs;

	//bi-directional many-to-one association to ConnectorState
	@ManyToOne
	@JoinColumn(name="REPAIR_CONNECTO_ID")
	private ConnectorState connectorState;

	//bi-directional many-to-one association to DetailRepair
	@ManyToOne
	@JoinColumn(name="DETAIL_ID")
	private DetailRepair detailRepair;

	public Repair() {
	}

	public long getRepairId() {
		return this.repairId;
	}

	public void setRepairId(long repairId) {
		this.repairId = repairId;
	}

	public BigDecimal getContId() {
		return this.contId;
	}

	public void setContId(BigDecimal contId) {
		this.contId = contId;
	}

	public String getContLinkMan() {
		return this.contLinkMan;
	}

	public void setContLinkMan(String contLinkMan) {
		this.contLinkMan = contLinkMan;
	}

	public BigDecimal getCustomerId() {
		return this.customerId;
	}

	public void setCustomerId(BigDecimal customerId) {
		this.customerId = customerId;
	}

	public String getCustomerName() {
		return this.customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getRepairConnectoName() {
		return this.repairConnectoName;
	}

	public void setRepairConnectoName(String repairConnectoName) {
		this.repairConnectoName = repairConnectoName;
	}

	public Date getRepairDatetime() {
		return this.repairDatetime;
	}

	public void setRepairDatetime(Date repairDatetime) {
		this.repairDatetime = repairDatetime;
	}

	public String getRepairMoveId() {
		return this.repairMoveId;
	}

	public void setRepairMoveId(String repairMoveId) {
		this.repairMoveId = repairMoveId;
	}

	public BigDecimal getRepairPerson() {
		return this.repairPerson;
	}

	public void setRepairPerson(BigDecimal repairPerson) {
		this.repairPerson = repairPerson;
	}

	public String getRepairTel() {
		return this.repairTel;
	}

	public void setRepairTel(String repairTel) {
		this.repairTel = repairTel;
	}

	public String getRepairType() {
		return this.repairType;
	}

	public void setRepairType(String repairType) {
		this.repairType = repairType;
	}

	public List<DetailRepair> getDetailRepairs() {
		return this.detailRepairs;
	}

	public void setDetailRepairs(List<DetailRepair> detailRepairs) {
		this.detailRepairs = detailRepairs;
	}

	public DetailRepair addDetailRepair(DetailRepair detailRepair) {
		getDetailRepairs().add(detailRepair);
		detailRepair.setRepair(this);

		return detailRepair;
	}

	public DetailRepair removeDetailRepair(DetailRepair detailRepair) {
		getDetailRepairs().remove(detailRepair);
		detailRepair.setRepair(null);

		return detailRepair;
	}

	public ConnectorState getConnectorState() {
		return this.connectorState;
	}

	public void setConnectorState(ConnectorState connectorState) {
		this.connectorState = connectorState;
	}

	public DetailRepair getDetailRepair() {
		return this.detailRepair;
	}

	public void setDetailRepair(DetailRepair detailRepair) {
		this.detailRepair = detailRepair;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Repair [repairId=" + repairId + ", contId=" + contId + ", contLinkMan=" + contLinkMan + ", customerId="
				+ customerId + ", customerName=" + customerName + ", repairConnectoName=" + repairConnectoName
				+ ", repairDatetime=" + repairDatetime + ", repairMoveId=" + repairMoveId + ", repairPerson="
				+ repairPerson + ", repairTel=" + repairTel + ", repairType=" + repairType + ", detailRepairs="
				+ detailRepairs + ", connectorState=" + connectorState + ", detailRepair=" + detailRepair + "]";
	}

	
	
}